﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Warehouse.IServices.Conveyorlines;
using Warehouse.IServices.TESinterface;
using Warehouse.ViewModels.TESinterfaceDTO;
using WCS.Entities.Api;
using WCS.Entities.TES;
using WCS.IServices;

namespace JuionWareHouse.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OneController : ControllerBase
    {
        private readonly IConveyorIServices Con;
        private readonly IDeviceManager _deviceManager;
        private readonly IPsCarServices PS;
        public OneController(IConveyorIServices con, IDeviceManager deviceManager, IPsCarServices pS)
        {
            Con = con;
            _deviceManager = deviceManager;
            PS = pS;
        }
        //申请站点
        [HttpPost]
        public IActionResult PreOccupyStation(FeederSitesDTO model)
        {
            return Ok(PS.preOccupyStation(model));
        }
        //容器上架
        [HttpPost]
        public IActionResult OccupyStation(Salver model)
        {
            return Ok(PS.occupyStation(model));
        }
        //小车搬运
        [HttpPost]
        public IActionResult NewMovePodTask(IanewayDTO model)
        {
            return Ok(PS.newMovePodTask(model));
        }
        //选则托盘垛过来
        [HttpPost]
        public IActionResult NewMovePodTasks(DispatchHandlingDTO model)
        {
            return Ok(PS.newMovePodTasks(model));
        }
        //站点释放
        [HttpPost]
        public IActionResult ReleaseStation(ContainerDTO model)
        {
            return Ok(PS.releaseStation(model));
        }
    }
}
